#ifndef _WIDGET_IMAGE_H_
#define _WIDGET_IMAGE_H_

#include <QtGui/QWidget>
#include <QImage>

#include "PEIncludes.h"
#include "PEImage.h"

class WidgetImage : public QWidget
{

	Q_OBJECT

public:

	WidgetImage(QWidget* a_Parent = 0, Qt::WFlags a_Flags = 0);
	~WidgetImage();

	void Resize();

	void Clear();

	bool Load(pe::PEImageRaw* a_Image);

private:

	// events

	void resizeEvent(QResizeEvent* a_Event);
	void paintEvent(QPaintEvent* a_Event);

	void UpdateDimensions();

	bool m_Clear;
	
	unsigned char* m_Data;
	unsigned int m_Width, m_Height;
	QImage* m_Image;
	QSizeF m_ImageSize;
	QPointF m_Offset;
	QSizeF m_Size;
	QRect m_StartSize;

}; // class WidgetImage

#endif